function getQueryString() {
	var qstr;
	var query;
	if ($("#basicSearch").is(":visible")) {
		query = $("#keyword").attr("value");
		qstr = "q=" + query; //escape(query);
	}
	else {
		if($("#allTheseWords").attr("value").length > 0) {
			query = $("#allTheseWords").attr("value");
			qstr = "mm=100&q=" + escape(query);
		}
		else if($("#exactPhrase").attr("value").length > 0) {
			query = $("#exactPhrase").attr("value");
			qstr = "q=" + escape("\"" + query + "\"");
		}
		else if($("#oneOrMore").attr("value").length > 0) {
			query = $("#oneOrMore").attr("value");
			qstr = "q=" + escape(query);
		} else {
			// TODO: use standard search
			query = $("#buildYourOwnQuery").attr("value");
			qstr = "q=" + escape(query);
		}
		
		if($("#unWantedWords").attr("value").length > 0) {
			query = $("#unWantedWords").attr("value");
			qstr = qstr + " NOT " + escape(query);
		}
	}
	
	return encodeURI(qstr);
}

function getStandardArgs() {
	var params = [ 'wt=json', 'qt=dismax', 'indent=on', 'hl=on' ,'hl.snippets=10', 'rows=100'];
	return params;
}

function checkHighlighting(objJSON, objField, sIndex){
	try {
		var sValue = objJSON.highlighting[sIndex][objField];
			if (sValue != "" && typeof(sValue) != "undefined")
					return "OK";
			else
		return "ERROR";
	}
	catch(err) {
		return "ERROR";
	}
}